package ute.mvc.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class OpenCourse_Subject {
	@Id
	@Column (length = 20)
	private String course_subjectId;
	@ManyToOne
	@JoinColumn (name = "openCourseId", nullable = false)
	private OpenCourse openCourse;
	@ManyToOne
	@JoinColumn (name = "subjectId", nullable = false)
	private Subject subject;
	
	@OneToMany(mappedBy="openCourse_Subject", fetch = FetchType.LAZY)
	Set<TestAndQuizz> listTestAndQuizz = new HashSet<TestAndQuizz>();
	
	@OneToMany(mappedBy = "openCourse_Subject")
	Set<Assignment> listAssignment = new HashSet<Assignment>();
	
	public Set<TestAndQuizz> getListTestAndQuizz() {
		return listTestAndQuizz;
	}
	public void setListTestAndQuizz(Set<TestAndQuizz> listTestAndQuizz) {
		this.listTestAndQuizz = listTestAndQuizz;
	}
	public String getCourse_subjectId() {
		return course_subjectId;
	}
	public void setCourse_subjectId(String course_subjectId) {
		this.course_subjectId = course_subjectId;
	}
	public OpenCourse getOpenCourse() {
		return openCourse;
	}
	public void setOpenCourse(OpenCourse openCourse) {
		this.openCourse = openCourse;
	}
	public Subject getSubject() {
		return subject;
	}
	public void setSubject(Subject subject) {
		this.subject = subject;
	}
	public Set<Assignment> getListAssignment() {
		return listAssignment;
	}
	public void setListAssignment(Set<Assignment> listAssignment) {
		this.listAssignment = listAssignment;
	}
	
}
